package com.cgsd.heyu.http;

import com.google.gson.Gson;

/**
 * @author xiaoxing
 * Created by Administrator on 2018/3/24.
 * 基础数据
 */

public class BaseResponse<T> {
    private String resultCode;
    private String resultMsg;
    private String error;
    /**
     * 普通数据
     */
    private T bizBody;
    /**
     * 是否有下一页
     */

    private boolean isMore;

    public int getCode() {
        if (resultCode == null){
            return 0;
        }
        return Integer.parseInt(resultCode);
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public T getBizBody() {
        return bizBody;
    }

    public void setBizBody(T bizBody) {
        this.bizBody = bizBody;
    }

    public boolean isMore() {
        return isMore;
    }

    public void setMore(boolean more) {
        isMore = more;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}
